package com.example.SpringBoot_demo.util;

import java.util.Random;

/**
 * 生成随机的userId
 *
 */
public class RandomUserId {
    public static String randomId(){
        Random random = new Random();
        String result="";
        for (int i=0;i<6;i++)//6位
        {
            result+=random.nextInt(10);//0~9
        }
        System.out.println(result);
        return result;
    }
}
